package chpt06;

import java.util.Arrays;
import java.util.Scanner;

public class ExceptionHandling {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int[] x=new int[in.nextInt()];
		for (int i = 0; i < x.length;) {
			String input=in.next();
			try{
				int y=Integer.parseInt(input);
				x[i]=y;
				i++;
			}catch(Exception e){
				System.out.println(e);
			}
		}
		System.out.println(Arrays.toString(x));
		in.close();
	}

}
